package exercise;

public class Automobile extends Car{

	private String type;
	
	public Automobile(String id, String brand, double price, String type) {
		this.setId(id);
		this.setBrand(brand);
		this.setPricePerDay(price);
		this.type = type;
	}
	
	public double calculate(int days) {
		double total = 0;
		if (days > 0 && days <= 7) {
			total = this.getPricePerDay() * days;
		} else if (days > 7 && days <= 30) {
			total = this.getPricePerDay() * days * 0.9;
		} else if (days > 30 && days <= 150) {
			total = this.getPricePerDay() * days * 0.8;
		} else if (days > 150) {
			total = this.getPricePerDay() * days * 0.7;
		}
		return total;
	}
}
